from multiprocessing import Pool
import  time

def f(n):
    return n*n

if __name__ =='__main__':
    t1=time.time()
    array = [1,2,3,4,5]
    p=Pool()
    result= p.map(f,array)
    p.close()
    p.join()
    print ('Pool took ',time.time()-t1)
    print (result)